﻿

#region Using Statements

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Xml;
using System.Xml.Serialization;
using System.Threading;
using System.ComponentModel;
using System.Reflection;

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Design;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;

using Freeform;
using FGame = Freeform.Game;
using XGame = Microsoft.Xna.Framework.Game;
using FComponent = Freeform.Component;
using FViewport = Freeform.Viewport;

#endregion


namespace Freeform
{
    /// <summary>
    /// This is the base class of a Freeform Game.
    /// </summary>
    public interface IGame
    {

        #region Members

        /// <summary>
        /// Gets the content manager for the control.
        /// </summary>
        ContentManager Content { get; }


        /// <summary>
        /// Gets the graphics device manager for this game.
        /// </summary>
        GraphicsDevice GraphicsDevice { get; }


        /// <summary>
        /// Gets or sets the spritebatch used to render the viewports to screen.
        /// </summary>
        SpriteBatch SpriteBatch { get; }


        /// <summary>
        /// Gets the list of viewports in this game.
        /// </summary>
        List<FViewport> Viewports { get; }


        /// <summary>
        /// Gets the list of worlds in this game.
        /// </summary>
        List<World> Worlds { get; }


        /// <summary>
        /// Gets or sets the background colour of the game.
        /// </summary>
        Color BackgroundColour { get; set; }


        /// <summary>
        /// Gets the random number generator used in this game.
        /// </summary>
        Random Random { get; }


        /// <summary>
        /// Gets an average frames per second value for the game.
        /// </summary>
        Int32 FPS { get; }


        /// <summary>
        /// Gets the fraction of CPU load used by the game.
        /// </summary>
        Single CPULoad { get; }


        /// <summary>
        /// Gets the components that are controlled directly by the game.
        /// </summary>
        ComponentList ComponentList { get; }


        /// <summary>
        /// Gets the input manager for this game.
        /// </summary>
        InputManager Input { get; }


        /// <summary>
        /// Gets the currently active RenderTarget for the Graphics Device.
        /// </summary>
        RenderTarget2D ActiveTarget { get; }


        /// <summary>
        /// Gets the KeyBinder which can be used to bind keys for the game.
        /// </summary>
        KeyBinder KeyBinder { get; }


        /// <summary>
        /// Gets a reference to a dictionary that can be used to lookup any Entity in the game via its ID.
        /// </summary>
        Dictionary<UInt64, Component> FreeformComponents { get; }

        #endregion


        #region Functions

        /// <summary>
        /// Allows the game to update itself.
        /// </summary>
        /// <param name="Time">Provides a snapshot of timing values.</param>
        //void Update(GameTime Time);

        /// <summary>
        /// Allows the game to draw itself.
        /// </summary>
        /// <param name="Time">Provides a snapshot of timing values.</param>
        //void Draw(GameTime Time);

        /// <summary>
        /// Returns the component of the given ID.
        /// </summary>
        /// <param name="ID">The ID of the component we would like to fetch.</param>
        /// <returns>A freeform component or null if the ID does not exist.</returns>
        Component GetComponent(UInt64 ID);

        /// <summary>
        /// Sets the RenderTarget for the graphics device.
        /// </summary>
        /// <param name="Target">The new Rendertarget for the graphics device.</param>
        void SetRenderTarget(RenderTarget2D Target);

        #endregion

    }
}